@import '~@/app/variables';

.loading {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  background-color: rgba(255, 255, 255, .8);
  opacity: 0;
  animation: opacity-animation 200ms 300ms forwards;

  @keyframes opacity-animation {
    to { opacity: 1 }
  }

  .content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .rotate {
    width: 50px;
    height: 50px;
    display: flex;
    flex-wrap: wrap;
    animation: Rotate 1.2s infinite linear;
    transform-origin: center center;

    i {
      margin: 10%;
      width: 30%;
      height: 30%;
      border-radius: 100%;
      background-color: $primary-color;

      &:nth-child(2) {
        opacity: .8;
      }

      &:nth-child(3) {
        opacity: .6;
      }

      &:nth-child(4) {
        opacity: .4;
      }
    }
  }

  .text {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translate(-50%, 100%);
    width: 300px;
    word-break: break-all;
    white-space: pre-wrap;
    text-align: center;
  }
}

@keyframes Rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
